import './App.css'
import {useCounterContext} from "./context/useCounterContext.ts";
import {ActionTypes} from "./context/state.ts";

function App() {
    const {state, dispatch} = useCounterContext();
    return (
        <>
            <div>Count: {state.count}</div>
            <button onClick={() => dispatch({type: ActionTypes.INCREMENT})}>+</button>
            <button onClick={() => dispatch({type: ActionTypes.DECREMENT})}>-</button>
            <button onClick={() => dispatch({type: ActionTypes.RESET})}>Reset</button>
        </>
    )
}

export default App
